//Cone.cpp
//Contains the function definitions for the Cone Class

#include <iostream>
#include <math.h>
#include "Cone.h"

using namespace std;

Cone::Cone(const float &p_X, const float &p_Y, float rad, float hgt)
	: CircularShapes(p_X, p_Y, rad)
{
	setHeight(hgt);
	setVol();
	setPerimeter(0);
	setShapeType("Cone");
}

void Cone::setHeight(float hgt)
{
	if (hgt >= 0.0)
		height = hgt;
	else
		cout << "The height must be greater than zero.";
}

float Cone::getHeight() const
{
	return height;
}

void Cone::setVol()
{
	//CN_volume = (getHeight() * Circle::getArea()) / 3;
	CN_volume = (getHeight() * CircularShapes::getArea()) / 3;
}

float Cone::getCnVol() const
{
	return CN_volume;
}

float Cone::volume() const
{
	return getCnVol();
}

